success_message = "Great Job! Click Submit Work."
success_image = (1, "green", "check")
success_points = 5
stage.set_background("winter")
sprite = codesters.Sprite("fox")
sprite.set_speed(2)
sprite.move_down(150)
stage.wait(1)
sprite.move_right(50)
sprite.say("Click on me!")
def click():
sprite.say("Hey there Codester!")
sprite.move_up(100)
sprite.turn_right(360)
sprite.move_down(100)
sprite.say("Great job.")
stage.wait(1)
sprite.say("Click submit and next to continue!")
sprite.event_click(click)
t = codesters.Teacher()
try:
params = t.find_block('def')
tval1 = params[0][1]
except:
tval1 = "DNE"
# try:
# params = t.find_function('say')
# tval2 = int(params[0][0])
# tval2a = t.get_indent_at_line(tval2)
# except:
# params = "DNE"
# tval2 = "DNE"
# tval2a = "DNE"
t1 = TestObjective()
t1.add_success('click()' in tval1, "Great Job! Be sure to click on your sprite!")
t1.add_failure(tval1 == "DNE", "Did you add Sprite Click?")
#t1.add_failure('click()' in tval1, "Did you add a stage event instead of a sprite event?")
#t1.add_creative('click_sprite()' not in tval1 and 'click()' not in tval1 and tval1 != "DNE", "You added a different event! Creative choice!")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)